package com.zjcode.cas.utils;


import java.text.ParseException;
import lombok.SneakyThrows;

public class SecurityUtil {
	public static String getEncryptedPwd(String password) throws Exception{
		return MD5Util.getEncryptedPwd(password);
	}
	
	public static boolean validPassword(String password, String encpassword){
		try {
			return MD5Util.validPassword(password, encpassword);
		} catch (Exception e){
			throw new RuntimeException();
		}
	}
	
	public static String decode(String inStr)throws Exception{
		return MD5Util.convertMD5(inStr);
	}

	public static String decrypt(String inStr)throws Exception{
		return MD5Util.convertMD5(inStr);
	}

	@SneakyThrows
	public static void main(String[] args) throws ParseException {
		String phone = "13485695175";
		// 加密
		String decode = decode(phone);
		// 解密
		String decrypt = decrypt(decode);

		System.out.println(phone);
		System.out.println(decode);
		System.out.println(decrypt);

	}
}
